package com.kfm.controller;

import com.kfm.model.Account;
import com.kfm.model.Req;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@Controller
public class ParamsController {

    @RequestMapping("/find")
    public String find(Integer id, String name, Account account, Req req, ArrayList<String> ids){
        return "hello";
    }


    @RequestMapping("/array")
    public String array(String[] ids){
        // ids=111&ids=222
        return "hello";
    }

    @RequestMapping("/param")
    public String param(@RequestParam("ids") List<String> ids, @RequestParam(value = "name", defaultValue = "abc") String username){
        return "hello";
    }

    @RequestMapping("/body1")
    public String body(@RequestBody String body){
        return "hello";
    }

    @RequestMapping("/body")
    public String body(@RequestBody Account body){
        return "hello";
    }

    @RequestMapping("/delete/{id}")
    public String delete(@PathVariable("id") String id){
        return "hello";
    }


}
